* Table 10

use "temp/EIA_clean.dta", clear
bys year: egen Imports = total(matfor) 
bys year: egen Exports = total(exports)
bys year: gen  ExportsUSD = Exports / er
gen DS = (Exports - Imports)/ totalsales
bys year: gen ImportsUSD = Imports / er
collapse ImportsUSD DS, by(year)

* Growth in imports between avg of 95-99 and 94
keep if year>=1994 & year<=1999
gen temp1 = 0
replace temp1 = 1 if year==1994	
foreach x of var ImportsUSD DS{
gen `x'temp = `x' * temp1
egen `x'94 = total(`x'temp)
gen `x'_growth = (`x'/`x'94-1)*100
gen `x'_delta = (`x'-`x'94)*100
drop `x'temp
}
drop if year==1994
collapse ImportsUSD_growth DS_delta
label var ImportsUSD_growth "Growth ImportsUSD"
label var DS_delta "delta DecifitOverS"
export excel ImportsUSD_growth DS_delta using "../../Output/Table10_Data", first(varl) replace
